// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Permissive License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace AjaxControlToolkit
{
    public class SidePanelCollection : ControlCollection
    {
        public SidePanelCollection(Control owner)
            : base(owner)
        {
        }

        public override void Add(Control child)
        {
            if (!(child is SidePanel))
            {
                throw new ArgumentException("SidePanelCollection can only contain SidePanel controls.");
            }
            base.Add(child);
        }

        public override void AddAt(int index, Control child)
        {
            if (!(child is SidePanel))
            {
                throw new ArgumentException("SidePanelCollection can only contain SidePanel controls.");
            }
            base.AddAt(index, child);
        }

        public new SidePanel this[int index]
        {
            get { return (SidePanel)base[index]; }
        }
    }
}
